for i in range(1, 11+1, 2):
    print(("*" * i).center(200))
for i in range(9, 0, -2):
    print(("*" * i).center(200))

# #打印100以内能被3整除的数字
# for i in range(1,100+1):
#     if i % 3 == 0:
#         print(i,end="\t")
#
# # 猜数字
# from  random import randint
# num = randint(1,30)
# while True:
#     guess = int(input("输入数字: "))
#     if guess > num:
#         print("太大了")
#     elif guess < num:
#         print("太小了")
#     else:
#         print("猜对了")
#         break
#
# # 逢7过
# for i in range(1,100+1):
#       # if i % 7 == 0 or str(i).find("7")!=-1:
#       # if i % 7 == 0 or str(i).count("7")>0:
#       if i % 7 == 0 or "7" in str(i)!=-1:
#          print(i,end="\t")
#
#
# #打印菱形
# for i in range(1,11+1,2):
#     print(("*" * i).center(200))
# for i in range(9,0,-2):
#     print(("*" * i).center(200))
#
#
# #打印菱形2多层嵌套
# row = eval(input('请输入菱形的行数：'))
# while row % 2 == 0:  # 判断行数的奇偶性
#     print('请重新输入菱形的行数：')
#     row = eval(input('请输入菱形的行数：'))
# # 输出菱形
# top_row = (row + 1) // 2  # 上半部分的行数
# # 上半部分
# for i in range(1, top_row + 1):  # 外层循环5行
#     # 倒三角形
#     for j in range(1, top_row + 1 - i):
#         print(' ', end='')
#     # 1，3，5，7，，，等腰三角形，range(1,2),range(1,4),range(1,6).....
#     for k in range(1, i * 2):
#         print('*', end='')
#     print()  # 当两个并列的for循环执行完成后，再换行
#
# # 下半部分
# bottom_row = row // 2
# for i in range(1, bottom_row + 1):
#     # 直角三角形
#     for j in range(1, i + 1):
#         print(' ', end='')
#     # 倒三角
#     for k in range(1, bottom_row * 2 - 2 * i + 2):  # 1-->range(1,6),2-->range(1,4),3-->range(1,2),
#         print('*', end='')
#     print()
#
#
# #打印水仙花数(水仙花数是指一个n位正整数，它的各位数字的n次幂之和等于它本身。例如，153是一个3位数)
# def is_narcissistic_num(num):
#     str_num = str(num)
#     num_digits = len(str_num)
#     sum_of_powers = sum(int(digit) ** num_digits for digit in str_num)
#     return num == sum_of_powers
# upper_limit = 10000
# narcissistic_nums = [num for num in range(10, upper_limit) if is_narcissistic_num(num)]
# for num in narcissistic_nums:
#     print(num)

# 打印100以内质数
# def is_prime(num):
#     if num <= 1:
#         return False
#    for i in range(2, int(num ** 0.5) + 1):
#         if num % i == 0:
#             return False
#     return True
# for i in range(2, 100):
#     if is_prime(i):
#         print(i)

# 打印斐波那契数列
# def fibonacci(num):
#   if num <= 0:
#      fib_list = []
# elif num == 1:
#    fib_list = [1]
# elif num >= 2:
#   fib_list = [1, 1]
# if num >= 3:
#   for i in range(num - 2):
#      fib_list.append(fib_list[i] + fib_list[i + 1])
# 打印范围内的斐波那契数列
# for i in fib_list:
#   if i <= num:
#      print(i, end=' ')
# # 3是个特例，需要单独处理
# if len(fib_list) == 3:
#   print(3, end=' ')
# elif fib_list == []:
#   print('空', end=' ')
# print()
# return fib_list
# # 调用函数打印斐波那契而数列
# while True:
#   num = int(input('请输入斐波那契数列长度的整数：'))
#  print('范围内：', end='')
# print(f'长度：{fibonacci(num)}')
#
# # 打印九九乘法表
# for i in range(1,10+1):
#  for j in range (1,i+1):
#    # print(j+"*"+"i"+"="+j*i,end="\t" )
#    print("%d*%d=%d"%(j,i,j*i),end="\t")
# print()
#
# # 打印100以内的完数
#
# for i in range(1,101):
# sum = 0
# for j in range(1,i):
#     if i % j == 0:
#        sum += j
# if sum == i:
#   print(f"{i}是完数")
